import Vue from 'vue';
import VueRouter from 'vue-router';
import HelloWorld from '../components/HelloWorld.vue';
import detail from '../components/detail.vue';

//安装插件
Vue.use(VueRouter); //挂载属性

//创建路由对象并配置路由规则
let router = new VueRouter({
	routes: [{
		path: '/',
		redirect: '/HelloWorld'
	}, {
		path: '/HelloWorld',
		component: HelloWorld
	}, {
		path: '/detail',
		component: detail
	}]
});

export default router;
